

#include <stdio.h>
#include <string.h>

#include "base64.h"

/*
 *  userid: Aladdin
 *  password: open sesame
 *  Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==
 */

int main(int argc, char ** argv)
{
	int in_len = 0, out_len = 0, inn_len = 0;
	char *in = "Aladdin:open sesame";
	char *out = NULL;
	char *inn = NULL;

	in_len = strlen(in);
	printf("\nin:%s\tlen:%d\n", in, in_len);
	out = base64_encode(in, in_len, &out_len, 72);
	printf("out:%s\tlen:%d\n",out,out_len);
	inn = base64_decode(out, out_len, &inn_len);
	printf("inn:%s\tlen:%d\n", inn, inn_len);

	return 0;
};


